#ifndef _GAME_H_
#define _GAME_H_

#include <UITest.h>
#include <MainWindow.h>

namespace pp
{
    class GameFSM;

    class Game : public ne::Singleton<Game>
    {
        public:
            Game();

            bool start();

            bool tick();

            bool render();

            void requestExit(int status);

            GameFSM* getGameFSM() const
            {
                return mpFSM;
            }

            uint32_t getStateID() const;

            MainWindow* getMainWindow() const
            {
                return mpMainWindow;
            }

            ne::Timer* getTimer() const
            {
                return mpTimer;
            }

            ne::real getDeltaTime() const
            {
                return mDeltaTime;
            }

            ne::real getTime() const
            {
                return mpTimer->getMilliseconds();
            }

            virtual ~Game();

        public:
            static Game& GetSingleton();

            static Game* GetSingletonPtr();

        private:
            GameFSM *mpFSM;
            MainWindow *mpMainWindow;
            UITest *mpUITest;
            ne::Timer *mpTimer;
            ne::real mDeltaTime;
            bool mRequestExit;
            bool mExitStatus;
    };
}

#endif
